# s = input()
s = "D"
# string= input()

string= "ABC"
res=1
for i in range(len(string)-1):
    for j in range(i+1,len(string)+1):
        print(i,j)
        temp= string[i:j]
        print(temp)
        dict1={}

        if s in temp:
            res=res =max(res,j-i)
            continue
        for c in temp:
            if c not in dict1:
                dict1[c] =1
            elif dict[c] >=2:
                res = max(res,j-i)
                break
            else:
                dict1[c] +=1
        print(dict1)
        res =max(res,j-i)
        print(res)
print(res)

